<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>

<s:include value="../header.jsp"></s:include>
<s:include value="../leftNav.jsp"></s:include>

<div id="content">

<div id="tabs">
	<ul>
		<li><s:a href="#tabs-1" action="testActionJsp.action">Customers list</s:a></li>
	</ul>
	<div id="tabs-1">
		<s:if test="customers.size > 0">
			<table id="customers">
				<tr style="background-color: highlight;">
					<td>id</td>
					<td>Company</td>
					<td>Director</td>
					<td>Licence</td>
					<td>Email</td>
					<td>Phone</td>
					<td>Fax</td>
				</tr>
				<s:iterator value="customers" status="customerStatus">
					<s:if test="#customerStatus.even == true">
						<tr style="background-color: silver;">
							<s:url id="editCustomer" value="editCustomerForm.action">
									<s:param name="editCustomerForm" value="true" />
									<s:param name="customerId" value="customerId" />
							</s:url>
							<td>
								<s:a href="%{editCustomer}">
									<s:property value="customerId" />
								</s:a>
							</td>
							<td>
								<s:a href="%{editCustomer}">
									<s:property value="companyName" />
								</s:a>
							</td>
							<td><s:property value="director" /></td>
							<td><s:property value="licenceDetail.licenceNr" /></td>
							<td><s:property value="email" /></td>
							<td><s:property value="phone" /></td>
							<td><s:property value="fax" /></td>
							<td><s:url id="deleteCustomer" value="deleteCustomer.action">
								<s:param name="customerId" value="customerId" />
							</s:url> <s:a href="%{deleteCustomer}">Delete</s:a></td>
						</tr>
					</s:if>
					<s:else>
						<tr style="background-color: threedhighlight;">
						<s:url id="editCustomer" value="editCustomerForm.action">
								<s:param name="editCustomerForm" value="true" />
								<s:param name="customerId" value="customerId" />
						</s:url>
						<td>
							<s:a href="%{editCustomer}">
								<s:property value="customerId" />
							</s:a>
						</td>
						<td>
							<s:a href="%{editCustomer}">
								<s:property value="companyName" />
							</s:a>
						</td>
						<td><s:property value="director" /></td>
						<td><s:property value="licenceDetail.licenceNr" /></td>
						<td><s:property value="email" /></td>
						<td><s:property value="fax" /></td>
						<td><s:property value="phone" /></td>
						<td><s:url id="deleteCustomer" value="deleteCustomer.action">
							<s:param name="customerId" value="customerId" />
						</s:url> <s:a href="%{deleteCustomer}">Delete</s:a></td>
					</tr>
					</s:else>
				</s:iterator>
			</table>
		</s:if>
	</div>
</div>